function [ybp] = ex3bp()
    load('Data/simdata.mat','t','y','ynf','ysin');
    load('Data/dict.mat','Fd', 'dx', 'Nd');
    
    fprintf(1, '-------------------BP Solution------------------\n');
    cvx_clear
    cvx_quiet(true)
    cvx_precision high
	cvx_begin
        variables x(2*Nd)
        minimize( norm( y - x'*Fd ) );
        subject to 
            x >= 0;
    cvx_end
    ybp = x'*Fd;%Rynf+Rysin
    
    index = 1:Nd;
    ybpa = x(index,:)'*Fd(index,:);%Rynf
    index = (Nd+1):2*Nd;
    ybpb = x(index,:)'*Fd(index,:);%Rysin
    % plot LS solutions
    figure;
    subplot(311);plot(t,ynf,'r',t,ybpa,'b');
    legend('ynf','Rynf');title('y of BP');
    subplot(312);plot(t,ysin,'r',t,ybpb,'b'); 
    legend('ysin','Rysin');
    subplot(313);plot(t,ynf+ysin,'r',t,ybp,'b');
    legend('ynf+ysin','Rynf+Rysin');
    %xlabel('Times');ylabel('Voltages');
    
    save('Data/bp.mat','ybp','ybpa','ybpb');
end